<?php
$likeClassCourses = peoplelikedClassCourse();
?>

<section class="contentCntr">
    <div class="container">
        <div class="row">              
            <div class="wide980">
                <div class="span12">
                    <div class="addmarginB10">
                        <h3 class="font-opensanslt remmarginT fnt-size24 txt000 txttTransformNorml fntweghtNml">People who liked this</h3>
                        <div class="crsl-items_like" data-navigation="crslNavTwo">
                            <div class="crsl-wrap">
                                <?php
                                if (!empty($likeClassCourses)) {
                                     $emptyImage = '<img src="' . baseUrl() . '../../' . getUploadDir() . '/no-class-image-240X180.jpg"   alt="class" id="classcourse">';
                                    foreach ($likeClassCourses as $likeClassCourses) {
                                        if (!empty($likeClassCourses->classes_id)) {
                                            $classId = $likeClassCourses->classes_id;
                                            $imageName = ClassImage::getPrimaryImage($classId);
                                            $className = $likeClassCourses->classes->class_titile;
                                            $userDetails = getUserTypeByClassCourse('Classes', $likeClassCourses->classes_id);
                                            $imagePath = getImagePathByClassCourse('Classes', $likeClassCourses->classes_id);
                                            $url = $this->createAbsoluteUrl('/classes/viewclass', array('id' => $likeClassCourses->classes_id));
                                        } else {
                                            $classId = $likeClassCourses->courses_id;
                                            $imageName = ClassImage::getCoursesPrimaryImage($classId);
                                            $url = $this->createAbsoluteUrl('/courses/viewcourse', array('id' => $likeClassCourses->courses_id));
                                            $className = $likeClassCourses->courses->course_titile;
                                            $userDetails = getUserTypeByClassCourse('Courses', $likeClassCourses->courses_id);
                                            $imagePath = getImagePathByClassCourse('Courses', $likeClassCourses->courses_id);
                                        }
                                        ?>

                                        <figure class="crsl-item">
                                            <div class="padding20px">
                                                <a href="<?php echo $url; ?>" ><?php echo (!empty($imageName)) ? '<img src="' . baseUrl() . '../../' . SkillConfig::getClassCourseImagePath($imagePath) . '240X180/' . $imageName . '"  alt="' . $className . '">':$emptyImage; ?></a>
                                                <p class="remmarginB font-opensansbd txtUpCase fnt-size11 txt999">By  <?php echo substr($userDetails->first_name . '  ' . $userDetails->last_name, 0, 40); ?></p>
                                                <a href="<?php echo $url; ?>" > <h6 class="remmarginT font-opensansbd txtUpCase fnt-size14 txt737 classcourseHeight"><?php echo substrclasscourname($className); ?></h6></a>
                                            </div>
                                        </figure>

                                        <?php
                                    }
                                }
                                ?>
                            </div>
                        </div>  
                    </div>                                    
                </div>
                <div id="crslNavTwo" class="crsl-nav">
                    <a href="javascript:void(0);" class="previous"><img src="<?php echo ThemePath(); ?>/images/grey-left-aw.png" alt="left-slide" /></a>
                    <a href="javascript:void(0);" class="next"><img src="<?php echo ThemePath(); ?>/images/grey-right-aw.png" alt="right-slide" /></a>
                </div>
            </div>  
        </div>
    </div>
</div>
</section>